package com.cskaoyan.controller.stat;

import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.vo.GoodsStatVO;
import com.cskaoyan.bean.vo.OrderStatVO;
import com.cskaoyan.bean.vo.UserStatVO;
import com.cskaoyan.service.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: Yang Yi-zhou
 * @Date: 2022/9/7 15:44
 * @Description:
 */
@RestController
@RequestMapping("admin/stat")
public class StatController {

    @Autowired
    StatService statService;

    @RequestMapping("user")
    public BaseRespVo userStat() {
        UserStatVO userStatVO = statService.userStat();
        return BaseRespVo.ok(userStatVO);
    }

    @RequestMapping("order")
    public BaseRespVo orderStat() {
       OrderStatVO orderStat = statService.orderStat();
        return BaseRespVo.ok(orderStat);
    }

    @RequestMapping("goods")
    public BaseRespVo goodsStat() {
        GoodsStatVO goodsStat = statService.goodsStat();
        return BaseRespVo.ok(goodsStat);
    }
}
